package cn.wegoteam.shop.po;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * ComboProduct entity. @author MyEclipse Persistence Tools �ײ���Ʒ������
 */
@Entity
@Table(name = "combo_product", catalog = "shop")
public class ComboProduct  extends BasePo implements java.io.Serializable {

	// Fields

	private Integer id;
	private Combo combo;
	private Product product;
	private Float productComboPrice;
	private int flag;//��־λ

	// Constructors

	/** default constructor */
	public ComboProduct() {
	}

	/** full constructor */
	public ComboProduct(Combo combo, Product product, Float productComboPrice) {
		this.combo = combo;
		this.product = product;
		this.productComboPrice = productComboPrice;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "combo_id")
	public Combo getCombo() {
		return this.combo;
	}

	public void setCombo(Combo combo) {
		this.combo = combo;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "product_id")
	public Product getProduct() {
		return this.product;
	}

	public void setProduct(Product product) {
		this.product = product;
	}

	@Column(name = "product_combo_price", precision = 12, scale = 0)
	public Float getProductComboPrice() {
		return this.productComboPrice;
	}

	public void setProductComboPrice(Float productComboPrice) {
		this.productComboPrice = productComboPrice;
	}
    @Column(name="flag",insertable=false,nullable=false)
	public Integer getFlag() {
		return flag;
	}

	public void setFlag(int flag) {
		this.flag = flag;
	}

}